from django.db import models



# class AuthGroup(models.Model):
#     name = models.CharField(unique=True, max_length=80)
#
#     class Meta:
#         managed = True
#         db_table = 'auth_group'

#
# class AuthGroupPermissions(models.Model):
#     group = models.ForeignKey(AuthGroup, models.DO_NOTHING)
#     permission = models.ForeignKey('AuthPermission', models.DO_NOTHING)
#
#     class Meta:
#         managed = True
#         db_table = 'auth_group_permissions'
#         unique_together = (('group', 'permission'),)

#
# class AuthPermission(models.Model):
#     name = models.CharField(max_length=255)
#     content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING)
#     codename = models.CharField(max_length=100)
#
#     class Meta:
#         managed = True
#         db_table = 'auth_permission'
#         unique_together = (('content_type', 'codename'),)

from django.contrib.auth.models import AbstractUser

class User(AbstractUser,models.Model):
    # password = models.CharField(max_length=128)
    # last_login = models.DateTimeField(blank=True, null=True)
    # is_superuser = models.IntegerField()
    # username = models.CharField(unique=True, max_length=150)
    # first_name = models.CharField(max_length=30)
    # last_name = models.CharField(max_length=150)
    # email = models.CharField(max_length=254)
    # is_staff = models.IntegerField()
    # is_active = models.IntegerField()
    # date_joined = models.DateTimeField()
    quanxian = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = True
        db_table = 'auth_user'


# class AuthUserGroups(models.Model):
#     user = models.ForeignKey(User, models.DO_NOTHING)
#     group = models.ForeignKey(AuthGroup, models.DO_NOTHING)
#
#     class Meta:
#         managed = True
#         db_table = 'auth_user_groups'
#         unique_together = (('user', 'group'),)

#
# class AuthUserUserPermissions(models.Model):
#     user = models.ForeignKey(User, models.DO_NOTHING)
#     permission = models.ForeignKey(AuthPermission, models.DO_NOTHING)
#
#     class Meta:
#         managed = True
#         db_table = 'auth_user_user_permissions'
#         unique_together = (('user', 'permission'),)


class Con(models.Model):
    con = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = True
        db_table = 'con'




class Info(models.Model):
    name = models.CharField(max_length=255, blank=True, null=True)
    age = models.IntegerField(blank=True, null=True)
    xueli = models.CharField(max_length=20, blank=True, null=True)
    fangxiang = models.CharField(max_length=20, blank=True, null=True)
    jieguo = models.CharField(max_length=20, blank=True, null=True)
    jianjie = models.CharField(max_length=255, blank=True, null=True)
    img = models.ImageField(upload_to='Uploadimage',default="Uploadimage/default.png")
    rw = models.CharField(max_length=255, blank=True, null=True)
    user = models.ForeignKey(User, models.DO_NOTHING, blank=True, null=True)

    class Meta:
        managed = True
        db_table = 'info'


class InfoCon(models.Model):
    info = models.ForeignKey(Info, models.DO_NOTHING, blank=True, null=True)
    con = models.ForeignKey(Con, models.DO_NOTHING, blank=True, null=True)
    wcd = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = True
        db_table = 'info_con'
